{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "385e99d0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "start=0&length=10&FilterData=%7B%22folio%22%3A%5B%2256500%22%2C%2256500%22%5D%2C%22bsmodel%22%3A%5B%22%22%5D%2C%22createdtime%22%3A%5Bnull%2Cnull%5D%2C%22predictdate%22%3A%5Bnull%2Cnull%5D%2C%22cwback%22%3A%5B%22%22%5D%2C%22sequenceno%22%3A%5B%22%22%5D%2C%22contractno%22%3A%5B%22%22%5D%2C%22region%22%3A%5B%22%22%5D%2C%22district%22%3A%5B%22%22%5D%2C%22ddy%22%3A%5B%22%22%5D%2C%22dzy%22%3A%5B%22%22%5D%2C%22ywy%22%3A%5B%22%22%5D%2C%22zd%22%3A%5B%22%22%5D%2C%22sdate%22%3A%5Bnull%2Cnull%5D%2C%22cud%22%3A%5B%22%22%5D%2C%22contnum%22%3A%5B%22%22%5D%2C%22kpdate%22%3A%5Bnull%2Cnull%5D%2C%22invoiceno%22%3A%5B%22%22%5D%2C%22priceclause%22%3A%5B%22%22%5D%2C%22issuingbank%22%3A%5B%22%22%5D%2C%22countries%22%3A%5B%22%22%5D%7D\n"
     ]
    }
   ],
   "source": [
    "from urllib.parse import urlencode\n",
    "\n",
    "data = {\n",
    "    \"start\": 0,\n",
    "    \"length\": 10,\n",
    "    \"FilterData\": '{\"folio\":[\"56500\",\"56500\"],\"bsmodel\":[\"\"],\"createdtime\":[null,null],\"predictdate\":[null,null],\"cwback\":[\"\"],\"sequenceno\":[\"\"],\"contractno\":[\"\"],\"region\":[\"\"],\"district\":[\"\"],\"ddy\":[\"\"],\"dzy\":[\"\"],\"ywy\":[\"\"],\"zd\":[\"\"],\"sdate\":[null,null],\"cud\":[\"\"],\"contnum\":[\"\"],\"kpdate\":[null,null],\"invoiceno\":[\"\"],\"priceclause\":[\"\"],\"issuingbank\":[\"\"],\"countries\":[\"\"]}'\n",
    "}\n",
    "\n",
    "\n",
    "print(urlencode(data))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "63798262",
   "metadata": {},
   "outputs": [
    {
     "ename": "",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31mThe Kernel crashed while executing code in the current cell or a previous cell. \n",
      "\u001b[1;31mPlease review the code in the cell(s) to identify a possible cause of the failure. \n",
      "\u001b[1;31mClick <a href='https://aka.ms/vscodeJupyterKernelCrash'>here</a> for more info. \n",
      "\u001b[1;31mView Jupyter <a href='command:jupyter.viewOutput'>log</a> for further details."
     ]
    }
   ],
   "source": [
    "import re"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "ac8036e4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "import torch.nn as nn"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "13cac68d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([[1., 1., 1., 1., 1., 1., 1., 1., 1., 1.],\n",
       "        [0., 1., 1., 1., 1., 1., 1., 1., 1., 1.],\n",
       "        [0., 0., 1., 1., 1., 1., 1., 1., 1., 1.],\n",
       "        [0., 0., 0., 1., 1., 1., 1., 1., 1., 1.],\n",
       "        [0., 0., 0., 0., 1., 1., 1., 1., 1., 1.],\n",
       "        [0., 0., 0., 0., 0., 1., 1., 1., 1., 1.],\n",
       "        [0., 0., 0., 0., 0., 0., 1., 1., 1., 1.],\n",
       "        [0., 0., 0., 0., 0., 0., 0., 1., 1., 1.],\n",
       "        [0., 0., 0., 0., 0., 0., 0., 0., 1., 1.],\n",
       "        [0., 0., 0., 0., 0., 0., 0., 0., 0., 1.]])"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "    mask=torch.ones(10,10) # (10,10) (5,8,10,10) (10,10) (1,1,10,10) (1,10,10) 都可以 只要是能和 (5,8,10,10) 能够进行广播机制都行\n",
    "    mask = torch.triu(mask,diagonal=0)\n",
    "    mask"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "615b250a",
   "metadata": {},
   "outputs": [],
   "source": [
    "s={}\n",
    "import json\n",
    "num_list = ['123123','1231231']\n",
    "s[json.dumps(num_list)] = {'a':123}\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "65689158",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'[\"123123\", \"1231231\"]'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "json.dumps(num_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "8cb2eee9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'[\"123123\", \"1231231\"]': {'a': 123}}"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "85b8e8d1",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "torch_py38",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.7rc1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
